package com.ruoyi.mall.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.MallOrderDetailMapper;
import com.ruoyi.mall.domain.MallOrderDetail;
import com.ruoyi.mall.service.IMallOrderDetailService;

/**
 * 订单详情管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-02
 */
@Service
public class MallOrderDetailServiceImpl implements IMallOrderDetailService 
{
    @Autowired
    private MallOrderDetailMapper mallOrderDetailMapper;

    /**
     * 查询订单详情管理
     * 
     * @param orderDetailId 订单详情管理主键
     * @return 订单详情管理
     */
    @Override
    public MallOrderDetail selectMallOrderDetailByOrderDetailId(Long orderDetailId)
    {
        return mallOrderDetailMapper.selectMallOrderDetailByOrderDetailId(orderDetailId);
    }

    /**
     * 查询订单详情管理列表
     * 
     * @param mallOrderDetail 订单详情管理
     * @return 订单详情管理
     */
    @Override
    public List<MallOrderDetail> selectMallOrderDetailList(MallOrderDetail mallOrderDetail)
    {
        return mallOrderDetailMapper.selectMallOrderDetailList(mallOrderDetail);
    }

    /**
     * 新增订单详情管理
     * 
     * @param mallOrderDetail 订单详情管理
     * @return 结果
     */
    @Override
    public int insertMallOrderDetail(MallOrderDetail mallOrderDetail)
    {
        mallOrderDetail.setCreateTime(DateUtils.getNowDate());
        return mallOrderDetailMapper.insertMallOrderDetail(mallOrderDetail);
    }

    /**
     * 修改订单详情管理
     * 
     * @param mallOrderDetail 订单详情管理
     * @return 结果
     */
    @Override
    public int updateMallOrderDetail(MallOrderDetail mallOrderDetail)
    {
        mallOrderDetail.setUpdateTime(DateUtils.getNowDate());
        return mallOrderDetailMapper.updateMallOrderDetail(mallOrderDetail);
    }

    /**
     * 批量删除订单详情管理
     * 
     * @param orderDetailIds 需要删除的订单详情管理主键
     * @return 结果
     */
    @Override
    public int deleteMallOrderDetailByOrderDetailIds(Long[] orderDetailIds)
    {
        return mallOrderDetailMapper.deleteMallOrderDetailByOrderDetailIds(orderDetailIds);
    }

    /**
     * 删除订单详情管理信息
     * 
     * @param orderDetailId 订单详情管理主键
     * @return 结果
     */
    @Override
    public int deleteMallOrderDetailByOrderDetailId(Long orderDetailId)
    {
        return mallOrderDetailMapper.deleteMallOrderDetailByOrderDetailId(orderDetailId);
    }
}
